# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidPublisher.V3.Model.IntroductoryPriceInfo do
  @moduledoc """
  Contains the introductory price information for a subscription.

  ## Attributes

  *   `introductoryPriceAmountMicros` (*type:* `String.t`, *default:* `nil`) - Introductory price of the subscription, not including tax. The currency is the same as price_currency_code. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000.
  *   `introductoryPriceCurrencyCode` (*type:* `String.t`, *default:* `nil`) - ISO 4217 currency code for the introductory subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP".
  *   `introductoryPriceCycles` (*type:* `integer()`, *default:* `nil`) - The number of billing period to offer introductory pricing.
  *   `introductoryPricePeriod` (*type:* `String.t`, *default:* `nil`) - Introductory price period, specified in ISO 8601 format. Common values are (but not limited to) "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), and "P1Y" (one year).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :introductoryPriceAmountMicros => String.t() | nil,
          :introductoryPriceCurrencyCode => String.t() | nil,
          :introductoryPriceCycles => integer() | nil,
          :introductoryPricePeriod => String.t() | nil
        }

  field(:introductoryPriceAmountMicros)
  field(:introductoryPriceCurrencyCode)
  field(:introductoryPriceCycles)
  field(:introductoryPricePeriod)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidPublisher.V3.Model.IntroductoryPriceInfo do
  def decode(value, options) do
    GoogleApi.AndroidPublisher.V3.Model.IntroductoryPriceInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidPublisher.V3.Model.IntroductoryPriceInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
